package com.pcbly.web.components.utils.property;

import java.util.Iterator;
import java.util.ResourceBundle;

public class LightsoftProperty {
	public static String FILENAME = "lightsoft";
	ResourceBundle resource;
	
	public LightsoftProperty() {
		resource=ResourceBundle.getBundle(FILENAME);
	}

	public LightsoftProperty(String strPropertiesFileName) {
		FILENAME = strPropertiesFileName;
		resource=ResourceBundle.getBundle(FILENAME);
	} 

	public String getString(String key) {
		return resource.getString(key);
	}

	public String getString(String key, String defaultValue) {
		String val = getString(key);
		if (val != null)
			return val;
		else
			return defaultValue;
	}
	public void close(){ 		
		resource=null;
	}
	public Iterator<String> getNames(){
		return resource.keySet().iterator();
	}

	public static void main(String args[]) {
		LightsoftProperty properties = new LightsoftProperty();
		Iterator<String>it=properties.getNames();
		while(it.hasNext())
		System.out.println(it.next());
	}

}
